
   
	<cfcomponent displayname="snip Service" hint="">

	<cffunction name="init" access="public" returntype="snipService" output="false">

		<cfreturn this/>

	</cffunction>

	<cffunction name="setsnipGateway" returntype="void" access="public" output="false" hint="dependency: snipGateway">
		<cfargument name="snipGateway" type="snipGateway" required="true"/>
		<cfset variables.m_snipGateway = arguments.snipGateway/>
	</cffunction>

	<cffunction name="setsnipDAO" returntype="void" access="public" output="false" hint="dependency: snipDAO">
		<cfargument name="snipDAO" type="snipDAO" required="true"/>
		<cfset variables.m_snipDAO = arguments.snipDAO/>
	</cffunction>

	<cffunction name="getAll" returntype="query" access="public" output="false" hint="I retrieve all existing snip">

		<cfreturn variables.m_snipGateway.getAll()/>
	</cffunction>

	<cffunction name="getById" returntype="any" access="public" output="false" hint="I retrieve a snip">
		<cfargument name="Id" type="numeric" required="true"/>
		<cfreturn variables.m_snipDAO.read(arguments.Id)/>
	</cffunction>

	<cffunction name="save" returntype="any" access="public" output="false" hint="I save a snip">
		<cfargument name="snip" type="snip" required="true"/>
		<cfreturn variables.m_snipDAO.save(arguments.snip)/>
	</cffunction>

	<cffunction name="remove" returntype="void" access="public" output="false" hint="I remove a snip">
		<cfargument name="snip" type="snip" required="true"/>
		<cfreturn variables.m_snipDAO.delete(arguments.snip)/>
	</cffunction>
	
	<cffunction name="getSnipsByLibID" access="public" returntype="query" output="false" displayname="" hint="">
		<cfargument name="libID" type="numeric" required="true" />
		<cfargument name="userID" type="string" required="true" />
		
		<cfreturn variables.m_snipGateway.getSnipsByLibID(libid=arguments.libID,userID=arguments.userID)/>
	</cffunction>
	
</cfcomponent>
	
  
